<template>
	<section>
		<list v-if="hasList" :is-processed="isProcessed" @jump-page="fnJumpPage"></list>
		<detail v-else :task-id="taskID" :apply-id="applyID" :is-processed="isProcessed" :page-type="pageType" @go-back="fnGoBack" @go-back-page="fnGoBackPage"></detail>
	</section>
</template>

<script>
    import List from './components/mealManagerment/ManagementList.vue'
    import Detail from './components/mealManagerment/ManagementDetail.vue'
	export default {
		data() {
			return {
				taskID : 0,
				applyID : 0,
				hasList:true,
				pageType:'',
				isProcessed : false
			}
		},
		components:{
			List,Detail
		},
		methods: {
			//自定义方法->切换为详细组件
			fnJumpPage(taskID,applyID,isProcessed){
				var that = this
				that.hasList = false
				that.taskID = taskID
				that.applyID = applyID
//				that.isProcessed = isProcessed
			},
			//自定义方法->切换为用餐列表组件
			fnGoBack(isProcessed){
				var that = this
				that.hasList = true
//				that.isProcessed = isProcessed
			},
			fnGoBackPage(url){
				this.$router.push({ path: url});
			}
		},
		mounted() {
			var that = this
			if (that.$route.query.applyID) {
				that.hasList = that.$route.query.hasList
				that.taskID = that.$route.query.taskID
				that.applyID = that.$route.query.applyID
				that.pageType = that.$route.query.pageType
			}
		}
	}
</script>

<style scoped>
</style>